/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 14785
 * Date: 2025-07-14
 * Time: 21:38
 */
public class Date {
    public int year;
    public int month;
    public int day;


    public Date() {
        //this.year = 2008;
        this(2021,1,1);
        System.out.println("这个是不带参数的构造方法....");
    }/**/

    public Date(int year,int month,int day) {
        //this();
        this.year = year;
        this.month = month;
        this.day = day;
        System.out.println("调用了带有3个参数的构造方法...");
    }/**/


    //写一个方法 来设置 年月日
    public void setDate(int year,int month,int day) {
        this.year = year;
        this.month = month;
        this.day = day;
    }
    public void printDate() {
        System.out.println(this.year+"年 "+this.month+"月 "+this.day+"日 ");
        //test();
    }

    public void test() {
        System.out.println("测试一下this....");
    }

    public static void main(String[] args) {

        Date date = new Date(2012,12,12);
        date.printDate();

    }


    public static void main1(String[] args) {

        //System.out.println(this.year);

        Date date = new Date();
        date.setDate(2008,8,8);
        date.printDate();

        Date date2 = new Date();
        date2.setDate(2009,9,9);
        date2.printDate();

        Date date3 = new Date();
        date3.setDate(2010,10,10);
        date3.printDate();

    }
}
